public class prog {

    public int peakIndexInMountainArray(int[] arr) {
        int left=1;
        int right=arr.length-2;
        int index=-1;
        while(left<=right){
            int mid=(left+right)/2;
            if(arr[mid]>arr[mid+1]){
                index=mid;
                right=mid-1;
            }else{
                left=mid+1;
            }
        }
        return index;
    }







    public static void main(String[] args){
        Object o=new Object(){
            public boolean equals(Object obj){
                return true;
            }
        };
        System.out.println(o.equals("Fred"));
    }




    public String name="abc";
    public static void main2(String[] args){
        prog test=new prog();
        prog testB=new prog();
        System.out.println(test.equals(testB)+","+test.name.equals(testB.name));
    }






    public static void main1(String[] args) {
        int i=0;
        Integer j = new Integer(0);
        System.out.println(i==j);
        System.out.println(j.equals(i));
    }
}
